package de.pa2.proxy.config;

import java.util.regex.Pattern;

public class Replacement {
	public static final String TAG = "replacement";
	private String urlPattern = null;
	private String lookup = null;
	private String replacement = null;
	private String pattern = null;

	public boolean matches(String url) {
		if (urlPattern == null)
			return true;
		return Pattern.matches(urlPattern, url);
	}

	public String getUrlPattern() {
		return urlPattern;
	}

	public void setUrlPattern(String urlPattern) {
		this.urlPattern = urlPattern;
	}

	public String getLookup() {
		return lookup;
	}

	public void setLookup(String lookup) {
		this.lookup = lookup;
	}

	public String getReplacement() {
		return replacement;
	}

	public void setReplacement(String replacement) {
		this.replacement = replacement;
	}

	public Replacement() {
	}

	public Replacement(String urlPattern, String lookup, String replacement) {
		super();
		this.urlPattern = urlPattern;
		this.lookup = lookup;
		this.replacement = replacement;
	}

	public String getPattern() {
		return pattern;
	}

	public void setPattern(String pattern) {
		this.pattern = pattern;
	}

}
